Configure IP Route Preferences

Before you begin

  • Disable ECMP before you configure route preferences.

Important

Important

Changing route preferences can affect system performance and network accessibility while you perform the procedure. You must therefore change a prefix list or a routing protocol before you activate the protocols.

About this task

Configure IP route preferences to give preference to routes learned for a specific protocol. You must disable ECMP before you configure route preferences.

To configure route preferences for a VRF, access VRF Router Configuration mode, rather than Global Configuration mode.

Procedure

  1. Enter either Global Configuration mode or VRF Router Configuration mode for a specific VRF context:

    enable

    configure terminal

    Optional: router vrf WORD<1-16>

  2. Configure the route preference:

    ip route preference protocol <static|ospf-intra|ospf-inter|ebgp|ibgp|rip|ospf-extern1|ospf-extern2|isis-external|isis-internal> <0-255>

  3. Confirm that the configuration is correct:

    show ip route preference [vrf WORD<1-16>] [vrfids WORD<0-512>]

Example

Switch:1>enable
Switch:1#configure terminal
Switch:1(config)#show ip route preference
==============================================================================
                       IP Route Preference - GlobalRouter
==============================================================================
PROTOCOL        DEFAULT    CONFIG
------------------------------------------------------------------------------
LOCAL           0          0
STATIC          5          5
ISIS-INTERNAL   7          140
OSPF_INTRA      20         20
OSPF_INTER      25         25
EBGP            45         45
RIP             100        100
OSPF_E1         120        120
OSPF_E2         125        125
ISIS-EXTERNAL   130        9
IBGP            175        175

View the route preference configuration for a specific VRF, for example 444.

Switch:1>enable
Switch:1#configure terminal
Switch:1(config)#router vrf test
Switch:1(router-vrf)#show ip route preference vrf 444
==============================================================================
                         IP Route Preference - VRF 444
==============================================================================
PROTOCOL        DEFAULT    CONFIG
------------------------------------------------------------------------------

LOCAL           0          0
STATIC          5          5
ISIS-INTERNAL   7          135
OSPF_INTRA      20         20
OSPF_INTER      25         25
EBGP            45         45
RIP             100        100
OSPF_E1         120        120
OSPF_E2         125        125
ISIS-EXTERNAL   130        11
IBGP            175        175

Variable definitions

Use the data in the following table to use the ip route preference protocol command.

Variable

Value

ebgp

Protocol type for ebgp.

ibgp

Protocol type for ibgp.

isis-external

Protocol type for IS-IS external routes.

isis-internal

Protocol type for IS-IS internal routes.

ospf-extern1

Protocol type for ospf-extern1 routes.

ospf-extern2

Protocol type for ospf-extern2 routes.

ospf-intra

Protocol type for ospf-intra routes.

ospf-inter

Protocol type for ospf-inter routes.

rip

Protocol type for rip routes.

static

Protocol type for static IP routes.

<0-255>

Specifies the preference value for the specified protocol.